package com.mini.demos.webgame.util;

import java.util.concurrent.atomic.AtomicInteger;

public class MsgSequenceId {
	
	private   AtomicInteger seq = new AtomicInteger(0);
	
	private static MsgSequenceId instance;
	
	private MsgSequenceId(){
		
	}
	
	public static MsgSequenceId getInstance(){
		if(instance == null){
			return new MsgSequenceId();
		}
		return instance;
	}
	
	public  synchronized  Integer getSequenceId(){
		return seq.getAndIncrement();
	}

}
